<template>
	<view class="container">
		<view class="user-info">
			<view>
				<view>头像</view>
				<view @click="modifyAvatar">
					<img :src="userInfo.avatar" alt="" />
					<view class="arrow">
						
					</view>
				</view>
			</view>
			<view>
				<view>姓名</view>
				<view>
					<view>{{identity == '' ? '普通用户' : identity.name}}</view>
				</view>
			</view>
			<view>
				<view>手机号</view>
				<view>
					<view>{{userInfo.phone}}</view>
					<view class="arrow">
						
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: '',
				identity: ''
			}
		},
		onLoad() {
			this.userInfo = wx.getStorageSync('userInfo')
			this.identity = uni.getStorageSync('identity')
		},
		methods: {
			modifyAvatar() {
				uni.navigateTo({
					url: '/pages/my/modifyAvatar/modifyAvatar'
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #fff;
	}
	
	.container {
		height: 100%;
		margin-top: 10rpx;
	}
	
	.user-info {
		padding: 0 40rpx;
	}
	
	.user-info > view {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 30rpx 0;
	}
	
	.user-info > view:nth-child(2n+1) > view:nth-child(2) {
		display: flex;
		align-items: center;
		height: 40rpx;
		line-height: 40rpx;
	}
	
	.user-info img {
		height: 70rpx;
		width: 70rpx;
		border-radius: 35rpx;
	}
	
	.arrow {
		width: 14rpx;
		height: 14rpx;
		margin-left: 20rpx;
		border-top: 2rpx solid #000;
		border-right: 2rpx solid #000;
		transform: rotate(45deg);
	}
</style>
